import request from '@/utils/request'

export default {
  getCoursePublishById(id) {
    return request({
      url: `/admin/edu/course/course-publish/${id}`,
      method: 'get'
    })
  },
  saveCourseInfo(course) {
    return request({
      url: `/admin/edu/course/save-course-info`,
      method: 'post',
      data: course
    })
  },
  editCourseInfo(course) {
    return request({
      url: `/admin/edu/course/edit-course-info`,
      method: 'post',
      data: course
    })
  },
  removeById(id) {
    return request({
      url: '/admin/edu/course/removeById/' + id,
      method: 'delete'
    })
  },
  batchRemove(idList) {
    return request({
      url: '/admin/edu/course/batchRemove',
      method: 'delete',
      data: idList
    })
  },
  listPage(page, size, searchObj) {
    return request({
      url: '/admin/edu/course/list/' + page + '/' + size,
      method: 'get',
      params: searchObj
    })
  },
  publishCourseById(id) {
    return request({
      url: `/admin/edu/course/publish-course/${id}`,
      method: 'put'
    })
  },
  getCourseInfoById(id) {
    return request({
      url: `/admin/edu/course/course-info/${id}`,
      method: 'get'
    })
  }
}
